import { model, Schema } from "mongoose";
import IUser from "./user.interface";

const UserEntityName = "User";
const userSchema = new Schema<IUser>({
  name: { type: String, required: true },
  email: { type: String, required: true, unique: true },
  password: { type: String, required: true },
});
/**
 *  User表 的 Model
 */
const userModel = model<IUser>(UserEntityName, userSchema);

export { UserEntityName };

export default userModel;
